<template>
  <tr>
    <td>
      <input type="checkbox" v-model="list.checked" />
    </td>
    <td>{{list.name}}</td>
    <td>{{list.price}}</td>
    <td>
      <button @click="list.num>0?list.num--:0">-1</button>
      {{list.num}}
      <button @click="list.num++">+1</button>
    </td>
    <td>{{list.num*list.price}}</td>
    <td>
      <button @click="del(index)">删除</button>
    </td>
  </tr>
</template>

<script>
export default {
  props: ['list','index'],
  methods: {
    del(index) {
      this.$emit('change',index)
    }
  }
}
</script>

<style >

</style>